﻿<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="Parent.aspx.cs" Inherits="tjb.WebTest.Dialog.Parent" %>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
    <title>无标题页</title>

    <script language="JavaScript" type="text/javascript">   
   <!-- 
    function $(id){
        return document.getElementById(id);
    }
  
      function showDialog(url,CallBack,width,height)
      {   
        if(!width){
            width = 600;
        }
        if(!height){
            height =400;
        }
        url ="show.htm?source="+escape(url)+"&w="+width + "&h="+ height+ "&ht=" + new Date();
       if(window.showModalDialog) //IE   
       {
           feature="dialogWidth:"+ width + "px;dialogHeight:"+ height +"px;status:no;help:no"; 
           window.returnAction=CallBack;  
           window.showModalDialog(url,window,feature);
       }
       else
       {
             //modelessDialog可以将modal换成dialog=yes   
           feature ="width="+ width + ",height="+ height +",menubar=no,toolbar=no,location=no,";   
           feature+="scrollbars=no,status=no,modal=no";  
          this.returnAction=CallBack;
           window.open(url,window,feature);
       }   
  }
  
  function RunCompleted(){
    alert(arguments.join(","));
    $("view").innerHTML=(arguments[0] +','+ arguments[1]);
  }
  //-->   
    </script>

</head>
<body>
    <form id="form1" runat="server">
    <div id="view">
    </div>
    <div>
        <input type="button" value="打开对话框" onclick="showDialog('someDialog.aspx?a=adsfadsf&b=cccc',RunCompleted)" />
    </div>
    </form>
</body>
</html>
